#include "iostream"
#include "queue"

#define MAP_WIDTH	15
#define MAP_HEIGHT	11
#define MAP_SIZE    (MAP_WIDTH * MAP_HEIGHT)

const int LEFT_TOP			=	0;
const int RIGHT_TOP			=	1;
const int RIGHT				=	2;
const int RIGHT_BOTTOM		=	3;
const int LEFT_BOTTOM		=	4;
const int LEFT				=	5;
const int DIRECTION_COUNT	=	6;//6 directions

int GetX(int m);
int GetY(int m);

int CreatePoint(int x,int y);
/**
Get the near point of the input parameter [pos],type if the direction of the point
if the point is not existed,such as outside the map,it returns -1
*/
int	GetNearPoint(int pos,int type);


/**
get the boundary of a unit can walk,Max_step means the step distance of the unit
@param:
Pos_Start:start position
outputMap:the array used to receive
*/
void GetCanWalk(int * mapData,int Pos_Start,int * outputMap,int Max_step = 0xff);
void GetCanWalk2(int * mapData,int Pos_Start,int * outputMap,int Max_step = 0xff);

/**
get the boundary of a unit can fly,Max_step means the step distance of the unit
@param:
Pos_Start:start position
*/
void GetCanFly(int * mapData,int Pos_Start,int * outputMap,int Max_step = 0xFFF);
void GetCanFly2(int * mapData,int Pos_Start,int * outputMap,int Max_step = 0xFFF);

/**
the array [Path] has been stored the route of the unit after invoking the function
and it returns how many steps the unit walks,
[outputMap] must be the return array invoked by GetCanWalk
and return -1 means startPos or TargetPos is barrier
*/
int GetWalkRoute(int * mapData,int StartPos, int TargetPos,const int * outputMap,int * Path);

int GetFlyRoute(int * mapData,int StartPos, int TargetPos,int * Path);

void PrintOutMap(int * pMap);


#define MAP_1	
//#define MAP_2	
//#define MAP_3	

